package com.oa.framework.acc.excuse.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.oa.framework.act.ProcessEvent;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;


/**
 * 账户请假申请
 * @author cuichao
 */
@Getter
@Setter
@TableName("acc_excuse")
public class AccountExcuse implements ProcessEvent {
    /**
     * 请假申请ID
     */
    @TableId(value = "excu_id" , type = IdType.ASSIGN_ID)
    private Long excuseId;
    /**
     * 发起人账户ID
     */
    @TableField(value = "excu_account_id")
    private Long accountId;
    /**
     * 请假事由
     */
    @TableField(value = "excu_description")
    private String description;
    /**
     * 请假开始时间
     */
    @TableField(value = "excu_start")
    private Date startTime;
    /**
     * 请假结束时间
     */
    @TableField(value = "excu_end")
    private Date endTime;
    /**
     * 创建时间
     */
    @TableField(value = "excu_ctime")
    private Date createTime;

    @TableField(value = "excu_def_id")
    private String definitionId;

    @TableField(value = "excu_ins_id")
    private String instanceId;

    @Override
    public String getSponsor() {
        return accountId.toString();
    }

    @Override
    public String getBusinessKey() {
        return excuseId.toString();
    }

    @Override
    public String getProcessDefinitionId() {
        return definitionId;
    }

    @Override
    public String getProcessInstanceId() {
        return instanceId;
    }
}
